package com.cskaoyan;

import com.cskaoyan.bean.Animal;
import com.cskaoyan.bean.Cat;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author stone
 * @date 2022/04/26 10:10
 */
public class MyTest2 {

    @Test
    public void mytest1() {
        //cat → proxy → Animal
        //dog → proxy → Animal
        //customBeanPostProcessor
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application.xml");
        //Cat cat = applicationContext.getBean(Cat.class);
        //Animal cat = applicationContext.getBean(Animal.class);
        Animal cat = applicationContext.getBean("cat",Animal.class);
        cat.shout();
        cat.shout();
        cat.shout();
        cat.toString();
    }
}
